

<%@ page import="org.tailor.Tailor" %>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="layout" content="main" />
  <g:set var="entityName" value="${message(code: 'tailor.label', default: 'Tailor')}" />
  <title><g:message code="default.edit.label" args="[entityName]" /></title>
</head>
<body>
  <div class="nav">
    <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
    <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span>
    <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
  </div>
  <div class="body">
    <h1><g:message code="default.edit.label" args="[entityName]" /></h1>
    <g:if test="${flash.message}">
      <div class="message">${flash.message}</div>
    </g:if>
    <g:hasErrors bean="${tailorInstance}">
      <div class="errors">
        <g:renderErrors bean="${tailorInstance}" as="list" />
      </div>
    </g:hasErrors>
    <g:form action="save" method="post" enctype="multipart/form-data" >
      <g:hiddenField name="id" value="${tailorInstance?.id}" />
      <g:hiddenField name="version" value="${tailorInstance?.version}" />
      <div class="dialog">
        <table>
          <tbody>
            <tr class="prop">
              <td valign="top" class="name">
                <label for="companyName"><g:message code="tailor.companyName.label" default="Company Name" /></label>
              </td>
              <td valign="top" class="value ${hasErrors(bean: tailorInstance, field: 'companyName', 'errors')}">
          <g:textField name="companyName"  value="${tailorInstance?.companyName}" />
          </td>
          </tr>
          <tr class="prop">
            <td valign="top" class="name">
              <label for="account"><g:message code="tailor.account.label" default="Account" /></label>
            </td>
            <td valign="top" class="value ${hasErrors(bean: tailorInstance, field: 'account', 'errors')}">
          <g:textField name="account"  value="${tailorInstance?.account}" />
          </td>
          </tr>

          <tr class="prop">
            <td valign="top" class="name">
              <label for="password"><g:message code="tailor.password.label" default="Password" /></label>
            </td>
            <td valign="top" class="value ${hasErrors(bean: tailorInstance, field: 'password', 'errors')}">
          <g:textField name="password"  value="${tailorInstance?.password}" />
          </td>
          </tr>
          <tr class="prop">
            <td valign="top" class="name">
              <label for="contactName"><g:message code="tailor.contactName.label" default="Contact Name" /></label>
            </td>
            <td valign="top" class="value ${hasErrors(bean: tailorInstance, field: 'contactName', 'errors')}">
          <g:textField name="contactName"  value="${tailorInstance?.contactName}" />
          </td>
          </tr>

          <tr class="prop">
            <td valign="top" class="name">
              <label for="address"><g:message code="tailor.address.label" default="Address" /></label>
            </td>
            <td valign="top" class="value ${hasErrors(bean: tailorInstance, field: 'address', 'errors')}">
          <g:textField name="address"  value="${tailorInstance?.address}" />
          </td>
          </tr>


          <tr class="prop">
            <td valign="top" class="name">
              <label for="country"><g:message code="tailor.country.label" default="Country" /></label>
            </td>
            <td valign="top" class="value ${hasErrors(bean: tailorInstance, field: 'country', 'errors')}">
          <g:textField name="country"  value="${tailorInstance?.country}" />
          </td>
          </tr>
          <tr class="prop">
            <td valign="top" class="name">
              <label for="regionsIdRegions"><g:message code="tailor.regionsIdRegions.label" default="Regions Id Regions" /></label>
            </td>
            <td valign="top" class="value ${hasErrors(bean: tailorInstance, field: 'regionsIdRegions', 'errors')}">
          <g:select name="regionsIdRegions.id" from="${org.tailor.Regions.list()}" optionKey="id" value="${tailorInstance?.regionsIdRegions?.id}"  />
          </td>
          </tr>
          <tr class="prop">
            <td valign="top" class="name">
              <label for="email"><g:message code="tailor.email.label" default="Email" /></label>
            </td>
            <td valign="top" class="value ${hasErrors(bean: tailorInstance, field: 'email', 'errors')}">
          <g:textField name="email"  value="${tailorInstance?.email}" />
          </td>
          </tr>

          <tr class="prop">
            <td valign="top" class="name">
              <label for="fax"><g:message code="tailor.fax.label" default="Fax" /></label>
            </td>
            <td valign="top" class="value ${hasErrors(bean: tailorInstance, field: 'fax', 'errors')}">
          <g:textField name="fax" value="${fieldValue(bean: tailorInstance, field: 'fax')}" />
          </td>
          </tr>




          <tr class="prop">
            <td valign="top" class="name">
              <label for="phone"><g:message code="tailor.phone.label" default="Phone" /></label>
            </td>
            <td valign="top" class="value ${hasErrors(bean: tailorInstance, field: 'phone', 'errors')}">
          <g:textField name="phone" value="${fieldValue(bean: tailorInstance, field: 'phone')}" />
          </td>
          </tr>

          <tr class="prop">
            <td valign="top" class="name">
              <label for="postalCode"><g:message code="tailor.postalCode.label" default="Postal Code" /></label>
            </td>
            <td valign="top" class="value ${hasErrors(bean: tailorInstance, field: 'postalCode', 'errors')}">
          <g:textField name="postalCode" value="${fieldValue(bean: tailorInstance, field: 'postalCode')}" />
          </td>
          </tr>



          <tr class="prop">
            <td valign="top" class="name">
              <label for="url"><g:message code="tailor.url.label" default="Url" /></label>
            </td>
            <td valign="top" class="value ${hasErrors(bean: tailorInstance, field: 'url', 'errors')}">
              <input type="file" id="img" name="img" />  
            </td>
          </tr>

          <tr class="prop">
            <td valign="top" class="name">
              <label for="notes"><g:message code="tailor.notes.label" default="Notes" /></label>
            </td>
            <td valign="top" class="value ${hasErrors(bean: tailorInstance, field: 'notes', 'errors')}">
          <g:textArea name="notes" cols="40" rows="5" value="${tailorInstance?.notes}" />
          </td>
          </tr>


          </tbody>
        </table>
      </div>
      <div class="buttons">
        <span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" /></span>
        <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
      </div>
    </g:form>
  </div>
</body>
</html>
